怎麼檢查 object 是不是空的?


Posted by Rich on 2021-09-12

有時候會有這種需求,這次解決的幫手是:

let obj = {}
if (Object.keys(obj).length === 0) //true

怕忘記,紀錄一下。










Related Posts

MTR04_1104

MTR04_1104

解決 git@github.com permission denied (publickey) fatal: Could not read from remote repository.

解決 git@github.com permission denied (publickey) fatal: Could not read from remote repository.

[day-5] 10分鐘了解陣列的簡易應用

[day-5] 10分鐘了解陣列的簡易應用


Comments